-
Notifications
You must be signed in to change notification settings - Fork 487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documents: Add support for URL-specific document variations - refs #5956 #5976
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,71 @@ | |||
<?php | |||
|
|||
declare(strict_types=1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a single space around assignment operators
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; | ||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | ||
|
||
class AddVariantResourceFileAction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing class doc comment
|
||
class AddVariantResourceFileAction | ||
{ | ||
public function __invoke(Request $request, EntityManagerInterface $em): ResourceFile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing function doc comment
@@ -59,6 +63,7 @@ class ResourceController extends AbstractResourceController implements CourseCon | |||
public function __construct( | |||
private readonly UserHelper $userHelper, | |||
private readonly ResourceNodeRepository $resourceNodeRepository, | |||
private readonly ResourceFileRepository $resourceFileRepository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected 4 spaces, found 8
@@ -136,21 +141,55 @@ | |||
* View file of a resource node. | |||
*/ | |||
#[Route('/{tool}/{type}/{id}/view', name: 'chamilo_core_resource_view', methods: ['GET'])] | |||
public function view(Request $request, TrackEDownloadsRepository $trackEDownloadsRepository): Response | |||
{ | |||
public function view( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You must use "/**" style comments for a function comment
@@ -212,8 +251,12 @@ public function link(Request $request, RouterInterface $router, CLinkRepository | |||
* Download file of a resource node. | |||
*/ | |||
#[Route('/{tool}/{type}/{id}/download', name: 'chamilo_core_resource_download', methods: ['GET'])] | |||
public function download(Request $request, TrackEDownloadsRepository $trackEDownloadsRepository): Response | |||
{ | |||
public function download( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You must use "/**" style comments for a function comment
@@ -458,15 +520,46 @@ | |||
return new Response(null, Response::HTTP_NO_CONTENT); | |||
} | |||
|
|||
private function processFile(Request $request, ResourceNode $resourceNode, string $mode = 'show', string $filter = '', ?array $allUserInfo = null): mixed | |||
#[Route('/resource_files/{resourceNodeId}/variants', name: 'chamilo_core_resource_files_variants', methods: ['GET'])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
@@ -458,15 +520,46 @@ | |||
return new Response(null, Response::HTTP_NO_CONTENT); | |||
} | |||
|
|||
private function processFile(Request $request, ResourceNode $resourceNode, string $mode = 'show', string $filter = '', ?array $allUserInfo = null): mixed | |||
#[Route('/resource_files/{resourceNodeId}/variants', name: 'chamilo_core_resource_files_variants', methods: ['GET'])] | |||
public function getVariants(string $resourceNodeId, EntityManagerInterface $em): JsonResponse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You must use "/**" style comments for a function comment
@@ -150,6 +183,11 @@ class ResourceFile implements Stringable | |||
#[ORM\Column(type: 'datetime')] | |||
protected $updatedAt; | |||
|
|||
#[ORM\ManyToOne(targetEntity: AccessUrl::class)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
@@ -150,6 +183,11 @@ | |||
#[ORM\Column(type: 'datetime')] | |||
protected $updatedAt; | |||
|
|||
#[ORM\ManyToOne(targetEntity: AccessUrl::class)] | |||
#[ORM\JoinColumn(name: 'access_url_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
return $this->json($data); | ||
} | ||
|
||
#[Route('/resource_files/{id}/delete_variant', methods: ['DELETE'], name: 'chamilo_core_resource_files_delete_variant')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
} | ||
|
||
#[Route('/resource_files/{id}/delete_variant', methods: ['DELETE'], name: 'chamilo_core_resource_files_delete_variant')] | ||
public function deleteVariant(int $id, EntityManagerInterface $em): JsonResponse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You must use "/**" style comments for a function comment
@@ -150,6 +183,11 @@ class ResourceFile implements Stringable | |||
#[ORM\Column(type: 'datetime')] | |||
protected $updatedAt; | |||
|
|||
#[ORM\ManyToOne(targetEntity: AccessUrl::class)] | |||
#[ORM\JoinColumn(name: 'access_url_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')] | |||
protected ?AccessUrl $accessUrl = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected 8 spaces, found 4
@@ -332,6 +370,17 @@ | |||
return $this; | |||
} | |||
|
|||
public function getAccessUrl(): ?AccessUrl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected 8 spaces, found 4
@@ -332,6 +370,17 @@ | |||
return $this; | |||
} | |||
|
|||
public function getAccessUrl(): ?AccessUrl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing function doc comment
Code Climate has analyzed commit 2fc1932 and detected 39 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
No description provided.